// Bango Blackberry 10 SDK Test App
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>

#include <QLocale>
#include <QTranslator>
#include <QtDebug>
#include <Qt/qdeclarativedebug.h>
#include "BangoBlackberry10App.hpp"

using namespace bb::cascades;


Q_DECL_EXPORT int main(int argc, char **argv)
{
	  Application app(argc, argv);
	  BangoBlackberry10App mainApp;
	  //allows manual handling of app exit event, in order to log end session and post events to Bango
	  app.setAutoExit(false);

	  QObject::connect(&app, SIGNAL(asleep()), &mainApp, SLOT(onAsleep()));
	  QObject::connect(&app, SIGNAL(awake()), &mainApp, SLOT(onAwake()));
	  QObject::connect(&app, SIGNAL(manualExit()), &mainApp, SLOT(onManualExit()));

	  mainApp.onStart();

	  return Application::exec();
}
